// app.js
App({
  onLaunch() {
    // 检查登录状态
    const isLoggedIn = wx.getStorageSync('isLoggedIn');
    if (!isLoggedIn) {
      wx.redirectTo({
        url: '/pages/login/login'
      });
    }
    
    // 获取系统信息
    const systemInfo = wx.getSystemInfoSync();
    this.globalData.systemInfo = systemInfo;
    
    // 计算安全区域
    if (systemInfo.safeArea) {
      this.globalData.safeArea = systemInfo.safeArea;
    }
  },
  
  globalData: {
    userInfo: null,
    systemInfo: null,
    safeArea: null,
    apiBaseUrl: 'https://api.moliwedding.com',
    token: '',
    colorPrimary: '#B76E79',  // 玫瑰金
    colorSecondary: '#F0DBBD',  // 香槟金
    colorBackground: '#FFFFF0',  // 象牙白
    version: '1.0.0'
  }
})
